{% extends "base.html" %}
{% load i18n %}
{% block title%}{% trans "luca_template_edit_template" %}{% endblock%}
{% block breadcrumbs%}<li><a href="/template">{% trans "luca_template_list" %}</a></li><li>{{template.name}}</li>{% endblock%}


 
{% block content %}
      {% if messages %}
	        {% for message in messages %}
	       		<div class="alert alert-success">
	        	 <a href="#" class="close" data-dismiss="alert">&times;</a>
	       			{{ message }}
	   			</div>
	        {% endfor %}  
	  {% endif %}    			
<div class="box-inner">
            <div class="box-header well" data-original-title="">
                <h2><i class="glyphicon glyphicon-edit"></i> {% trans "luca_template_edit_template" %}</h2>

              
            </div>
            <div class="box-content">
                <form action="/template/process_edit/{{template.id}}/" role="form" method="POST">
                {% csrf_token %}
                    <div class="form-group">
                        <label for="exampleInputEmail1">{% trans "luca_template_name" %}</label>
                        <input type="text" class="form-control required" name="name" value="{{template.name}}">
                    </div>
                    <div class="form-group">
                        <label>{% trans "luca_template_content" %}</label>
                        <textarea class="form-control required" name="content">{{template.content}}</textarea>
                        <p class="help-block">{% trans "luca_template_rules" %}</p> 	
                     </div>
                
                   
                      <div class="checkbox">
                      	<input name="active" type="hidden" value="0">
                      	<label class="boolean optional" for="user_basic_active">
                      		<input class="boolean optional" id="user_basic_active" name="active" type="checkbox" value="1"
                      		{% if template.active == 1 %}
                      		checked
							{% endif %}
                      		>
                      		{% trans "active" %}
                      		</label>
                      	</div>
                  
                    <button type="submit" class="btn btn-default">{% trans "edit" %}</button>
                    <a href="/template/process_delete/{{template.id}}/"><button type="button" class="btn btn-default">{% trans "delete" %}</button></a>
                </form>

            </div>
        </div>
        



{% endblock %}
